home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Kids / TimesTable / TimesTable.AMOS / TimesTable.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1998-01-16  |  19.3 KB  |  736 lines

  1. '15.06.94  
  2. '                             THE TIMES-TABLES 
  3. '                             ~~~~~~~~~~~~~~~~~
  4. '
  5. '                                    By
  6.  
  7. '                               Paul Bartlett  
  8. '                               ~~~~~~~~~~~~~  
  9.  
  10. 'About the Program 
  11. '~~~~~~~~~~~~~~~~~ 
  12. 'This program is very simple to use. When the title screen appears, click on 
  13. 'a 'Box' for the required TIMESTABLE??.
  14. 'The screen will then contain the selected TIMESTABLE??. Click on a 'Box' to 
  15. 'complete each multiplication until all sums have been correctly answered. 
  16. 'You are then returned to the title screen to start the above again. 
  17. 'There are 10 random settings for the positioning of the 'Boxes'. I put these
  18. 'random positions in as  my children began relying on the actual position of 
  19. 'the 'Boxes' and not the answers they contained. Anyway, feel free to add to 
  20. 'these, or even insert your own random routine.        
  21.  
  22. 'Throughout the program I have put notes so anyone can learn from or find  
  23. 'amusement at the code.  
  24. 'Before reading any notes, I suggest you run the program first to see what 
  25. 'actually happens. 
  26.  
  27. '----------------------------------------------------------------------------
  28. 'Open up the screen etc. 
  29. '----------------------------------------------------------------------------
  30. Screen Open 0,640,256,16,Hires
  31. Dim A$(12)
  32. Limit Mouse 360,75 To 428,257
  33. Sam Bank 5
  34. Global B1,B2,B3,B4,B5,RB,Y,X1,X2,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12,WB$,ANSWER,A$()
  35. CB$="Click A Box to Complete Sum"
  36. WB$="Wrong Box - Try Again"
  37.  
  38. '----------------------------------------------------------------------------
  39. 'Lets unpack the title screen and place the 'WHICH TIMESTABLE??' Zones.  
  40. '----------------------------------------------------------------------------
  41. SELECTION:
  42. Unpack 6 To 0 : Paper 0
  43. Sam Play 4
  44. Reserve Zone 12
  45. A$(1)="  2 "
  46. A$(2)="  3 "
  47. A$(3)="  4 "
  48. A$(4)="  5 "
  49. A$(5)="  6 "
  50. A$(6)="  7 "
  51. A$(7)="  8 "
  52. A$(8)="  9 "
  53. A$(9)=" 1O "
  54. A$(10)=" 11 "
  55. A$(11)=" 12 "
  56.  
  57. '----------------------------------------------------------------------------
  58. 'Lets give a 'Quit' option by tying up the Esc.Key on the title screen and 
  59. 'place the 'Boxes' to select the required TIMESTABLE??   
  60. '----------------------------------------------------------------------------
  61. Repeat 
  62.    If Key State(69) Then Goto _RETURN_TO_EDITSCREEN
  63.    
  64.    Pen 2
  65.    Locate 62,5 : Print Border$(Zone$(A$(1),1),3)
  66.    Locate 68,7 : Print Border$(Zone$(A$(2),2),3)
  67.    Locate 62,9 : Print Border$(Zone$(A$(3),3),3)
  68.    Locate 68,11 : Print Border$(Zone$(A$(4),4),3)
  69.    Locate 62,13 : Print Border$(Zone$(A$(5),5),3)
  70.    Locate 68,15 : Print Border$(Zone$(A$(6),6),3)
  71.    Locate 62,17 : Print Border$(Zone$(A$(7),7),3)
  72.    Locate 68,19 : Print Border$(Zone$(A$(8),8),3)
  73.    Locate 62,21 : Print Border$(Zone$(A$(9),9),3)
  74.    Locate 68,23 : Print Border$(Zone$(A$(10),10),3)
  75.    Locate 62,25 : Print Border$(Zone$(A$(11),11),3)
  76.    
  77.    '----------------------------------------------------------------------------  
  78.    'On SELECTION of Zone, Goto the requested TIMESTABLE?? 
  79.    '----------------------------------------------------------------------------
  80.    M=Mouse Zone
  81.    If Mouse Key and M=1 Then Sam Play 1 : Goto TIMESTABLE2
  82.    If Mouse Key and M=2 Then Sam Play 1 : Goto TIMESTABLE3
  83.    If Mouse Key and M=3 Then Sam Play 1 : Goto TIMESTABLE4
  84.    If Mouse Key and M=4 Then Sam Play 1 : Goto TIMESTABLE5
  85.    If Mouse Key and M=5 Then Sam Play 1 : Goto TIMESTABLE6
  86.    If Mouse Key and M=6 Then Sam Play 1 : Goto TIMESTABLE7
  87.    If Mouse Key and M=7 Then Sam Play 1 : Goto TIMESTABLE8
  88.    If Mouse Key and M=8 Then Sam Play 1 : Goto TIMESTABLE9
  89.    If Mouse Key and M=9 Then Sam Play 1 : Goto TIMESTABLE10
  90.    If Mouse Key and M=10 Then Sam Play 1 : Goto TIMESTABLE11
  91.    If Mouse Key and M=11 Then Sam Play 1 : Goto TIMESTABLE12
  92. Until Mouse Key and M>12
  93.  
  94.  
  95. '*************************** TIMESTABLE????? ********************************  
  96.  
  97. '----------------------------------------------------------------------------  
  98. 'When entering TIMESTABLE??, we are sent to a procedure holding the  
  99. 'variables that decide which set of Bobs are to be displayed.
  100. '_GIRLBOB (TIMESTABLE 2,4,6,8,10,12) will display the little girl Bobs, and  
  101. '_BOYBOB (TIMESTABLE 1,3,5,7,9,11) will display the little boy Bobs. 
  102.  
  103. 'P = the pen colour of the answer 'Boxes'.   
  104.  
  105. 'C$ = When we jump to the TIMES_TABLE label, this tells us which number  
  106. '     is being multiplied. ie 1 x C$ = 
  107. '                             2 x C$ =  and so on. 
  108.  
  109. 'A$(1) to A$(12) are the answers to each multiplication. 
  110.  
  111. '_XYBOX_POSITION gives the coordinates of the 'Boxes' which hold the answers.
  112.  
  113. 'Therefore, we now know which Bobs we are going to use, which colour 
  114. 'the 'Boxes' are going to be, the number of TIMESTABLE?? we have selected,   
  115. 'the answers for that TIMESTABLE??, and also the position our answers are to 
  116. 'be displayed in.  
  117. 'Its now time to Goto 'CLASSROOM' where we answer the sums.    
  118. '----------------------------------------------------------------------------
  119. TIMESTABLE2:
  120. _GIRLBOB
  121. P=14
  122. C$="2"
  123. A$(1)="  2 "
  124. A$(2)="  4 "
  125. A$(3)="  6 "
  126. A$(4)="  8 "
  127. A$(5)=" 1O "
  128. A$(6)=" 12 "
  129. A$(7)=" 14 "
  130. A$(8)=" 16 "
  131. A$(9)=" 18 "
  132. A$(10)=" 2O "
  133. A$(11)=" 22 "
  134. A$(12)=" 24 "
  135. _XYBOX_POSITION
  136. Goto CLASSROOM
  137.  
  138. TIMESTABLE3:
  139. _BOYBOB
  140. P=6
  141. C$="3"
  142. A$(1)="  3 "
  143. A$(2)="  6 "
  144. A$(3)="  9 "
  145. A$(4)=" 12 "
  146. A$(5)=" 15 "
  147. A$(6)=" 18 "
  148. A$(7)=" 21 "
  149. A$(8)=" 24 "
  150. A$(9)=" 27 "
  151. A$(10)=" 3O "
  152. A$(11)=" 33 "
  153. A$(12)=" 36 "
  154. _XYBOX_POSITION
  155. Goto CLASSROOM
  156.  
  157. TIMESTABLE4:
  158. _GIRLBOB
  159. P=14
  160. C$="4"
  161. A$(1)="  4 "
  162. A$(2)="  8 "
  163. A$(3)=" 12 "
  164. A$(4)=" 16 "
  165. A$(5)=" 2O "
  166. A$(6)=" 24 "
  167. A$(7)=" 28 "
  168. A$(8)=" 32 "
  169. A$(9)=" 36 "
  170. A$(10)=" 4O "
  171. A$(11)=" 44 "
  172. A$(12)=" 48 "
  173. _XYBOX_POSITION
  174. Goto CLASSROOM
  175.  
  176. TIMESTABLE5:
  177. _BOYBOB
  178. P=6
  179. C$="5"
  180. A$(1)="  5 "
  181. A$(2)=" 1O "
  182. A$(3)=" 15 "
  183. A$(4)=" 2O "
  184. A$(5)=" 25 "
  185. A$(6)=" 3O "
  186. A$(7)=" 35 "
  187. A$(8)=" 4O "
  188. A$(9)=" 45 "
  189. A$(10)=" 5O "
  190. A$(11)=" 55 "
  191. A$(12)=" 6O "
  192. _XYBOX_POSITION
  193. Goto CLASSROOM
  194.  
  195. TIMESTABLE6:
  196. _GIRLBOB
  197. P=14
  198. C$="6"
  199. A$(1)="  6 "
  200. A$(2)=" 12 "
  201. A$(3)=" 18 "
  202. A$(4)=" 24 "
  203. A$(5)=" 3O "
  204. A$(6)=" 36 "
  205. A$(7)=" 42 "
  206. A$(8)=" 48 "
  207. A$(9)=" 54 "
  208. A$(10)=" 6O "
  209. A$(11)=" 66 "
  210. A$(12)=" 72 "
  211. _XYBOX_POSITION
  212. Goto CLASSROOM
  213.  
  214. TIMESTABLE7:
  215. _BOYBOB
  216. P=6
  217. C$="7"
  218. A$(1)="  7 "
  219. A$(2)=" 14 "
  220. A$(3)=" 21 "
  221. A$(4)=" 28 "
  222. A$(5)=" 35 "
  223. A$(6)=" 42 "
  224. A$(7)=" 49 "
  225. A$(8)=" 56 "
  226. A$(9)=" 63 "
  227. A$(10)=" 7O "
  228. A$(11)=" 77 "
  229. A$(12)=" 84 "
  230. _XYBOX_POSITION
  231. Goto CLASSROOM
  232.  
  233. TIMESTABLE8:
  234. _GIRLBOB
  235. P=14
  236. C$="8"
  237. A$(1)="  8 "
  238. A$(2)=" 16 "
  239. A$(3)=" 24 "
  240. A$(4)=" 32 "
  241. A$(5)=" 4O "
  242. A$(6)=" 48 "
  243. A$(7)=" 56 "
  244. A$(8)=" 64 "
  245. A$(9)=" 72 "
  246. A$(10)=" 8O "
  247. A$(11)=" 88 "
  248. A$(12)=" 96 "
  249. _XYBOX_POSITION
  250. Goto CLASSROOM
  251.  
  252. TIMESTABLE9:
  253. _BOYBOB
  254. P=6
  255. C$="9"
  256. A$(1)="  9 "
  257. A$(2)=" 18 "
  258. A$(3)=" 27 "
  259. A$(4)=" 36 "
  260. A$(5)=" 45 "
  261. A$(6)=" 54 "
  262. A$(7)=" 63 "
  263. A$(8)=" 72 "
  264. A$(9)=" 81 "
  265. A$(10)=" 90 "
  266. A$(11)=" 99 "
  267. A$(12)="1O8 "
  268. _XYBOX_POSITION
  269. Goto CLASSROOM
  270.  
  271. TIMESTABLE10:
  272. _GIRLBOB
  273. P=14
  274. C$="10"
  275. A$(1)=" 1O "
  276. A$(2)=" 2O "
  277. A$(3)=" 3O "
  278. A$(4)=" 4O "
  279. A$(5)=" 5O "
  280. A$(6)=" 6O "
  281. A$(7)=" 7O "
  282. A$(8)=" 80 "
  283. A$(9)=" 9O "
  284. A$(10)="1OO "
  285. A$(11)="11O "
  286. A$(12)="12O "
  287. _XYBOX_POSITION
  288. Goto CLASSROOM
  289.  
  290. TIMESTABLE11:
  291. _BOYBOB
  292. P=6
  293. C$="11"
  294. A$(1)=" 11 "
  295. A$(2)=" 22 "
  296. A$(3)=" 33 "
  297. A$(4)=" 44 "
  298. A$(5)=" 55 "
  299. A$(6)=" 66 "
  300. A$(7)=" 77 "
  301. A$(8)=" 88 "
  302. A$(9)=" 99 "
  303. A$(10)="11O "
  304. A$(11)="121 "
  305. A$(12)="132 "
  306. _XYBOX_POSITION
  307. Goto CLASSROOM
  308.  
  309. TIMESTABLE12:
  310. _GIRLBOB
  311. P=14
  312. C$="12"
  313. A$(1)=" 12 "
  314. A$(2)=" 24 "
  315. A$(3)=" 36 "
  316. A$(4)=" 48 "
  317. A$(5)=" 6O "
  318. A$(6)=" 72 "
  319. A$(7)=" 84 "
  320. A$(8)=" 96 "
  321. A$(9)="1O8 "
  322. A$(10)="12O "
  323. A$(11)="132 "
  324. A$(12)="144 "
  325. _XYBOX_POSITION
  326. Goto CLASSROOM
  327.  
  328. '*****************************  Times Table  ********************************  
  329.  
  330. CLASSROOM:
  331. '----------------------------------------------------------------------------
  332. 'Draw the grid 
  333. '----------------------------------------------------------------------------
  334. Ink 7
  335. Box 210,26 To 435,218
  336. Draw 210,42 To 435,42
  337. Draw 210,58 To 435,58
  338. Draw 210,74 To 435,74
  339. Draw 210,90 To 435,90
  340. Draw 210,106 To 435,106
  341. Draw 210,122 To 435,122
  342. Draw 210,138 To 435,138
  343. Draw 210,154 To 435,154
  344. Draw 210,170 To 435,170
  345. Draw 210,186 To 435,186
  346. Draw 210,202 To 435,202
  347. Draw 405,26 To 405,218
  348.  
  349. '----------------------------------------------------------------------------
  350. 'Print the selected TIMESTABLE?? 
  351. '----------------------------------------------------------------------------
  352. Pen 2
  353. Locate 31,4 : Print "1)   1 x "+C$+" ="
  354. Locate 31,6 : Print "2)   2 x "+C$+" ="
  355. Locate 31,8 : Print "3)   3 x "+C$+" ="
  356. Locate 31,10 : Print "4)   4 x "+C$+" ="
  357. Locate 31,12 : Print "5)   5 x "+C$+" ="
  358. Locate 31,14 : Print "6)   6 x "+C$+" ="
  359. Locate 31,16 : Print "7)   7 x "+C$+" ="
  360. Locate 31,18 : Print "8)   8 x "+C$+" ="
  361. Locate 31,20 : Print "9)   9 x "+C$+" ="
  362. Locate 31,22 : Print "10)  10 x "+C$+" ="
  363. Locate 31,24 : Print "11)  11 x "+C$+" ="
  364. Locate 31,26 : Print "12)  12 x "+C$+" ="
  365.  
  366. Paste Bob 30,50,B1
  367.  
  368. '----------------------------------------------------------------------------  
  369. 'Print the 'Boxes' with the answers from the selected TIMESTABLE??.  
  370. '----------------------------------------------------------------------------
  371. Pen P
  372. Locate X1,Y1 : Print Border$(Zone$(A$(1),1),3)
  373. Locate X2,Y7 : Print Border$(Zone$(A$(2),2),3)
  374. Locate X1,Y2 : Print Border$(Zone$(A$(3),3),3)
  375. Locate X2,Y8 : Print Border$(Zone$(A$(4),4),3)
  376. Locate X1,Y3 : Print Border$(Zone$(A$(5),5),3)
  377. Locate X2,Y9 : Print Border$(Zone$(A$(6),6),3)
  378. Locate X1,Y4 : Print Border$(Zone$(A$(7),7),3)
  379. Locate X2,Y10 : Print Border$(Zone$(A$(8),8),3)
  380. Locate X1,Y5 : Print Border$(Zone$(A$(9),9),3)
  381. Locate X2,Y11 : Print Border$(Zone$(A$(10),10),3)
  382. Locate X1,Y6 : Print Border$(Zone$(A$(11),11),3)
  383. Locate X2,Y12 : Print Border$(Zone$(A$(12),12),3)
  384.  
  385. '----------------------------------------------------------------------------
  386. 'This is where we answer the sums. 
  387. 'Centre CB$ -Click a Box to Complete Sum +"Sum Number"-  
  388. 'If the correct 'Box' is chosen then remove the number in the Box and visit
  389. 'the procedure called _CORRECTBOB. We then goto the next sum...  
  390. '..ie TIMES1: to TIMES2: etc.  
  391.  
  392. 'If the wrong 'Box' is chosen then visit the procedure called _CROSSBOB.   
  393. 'Goto the start of this sum again until the correct Box is chosen.   
  394. 'Note...See the Procs for details of what they do. 
  395. '----------------------------------------------------------------------------
  396. TIMES1:
  397. Pen 5 : Locate ,2 : Centre CB$+" 1"
  398. M=Mouse Zone : Y=4 : ANSWER=1
  399. Repeat 
  400.    K$=Inkey$
  401.    Clear Key 
  402.    If Lower$(K$)="q" or Asc(K$)=27
  403.       Goto SELECTION
  404.    End If 
  405.    Wait 1
  406. Until Mouse Key
  407. If M>1 Then Sam Play 3 : _CROSSBOB
  408. If M=1 Then Sam Play 2 : Locate X1,Y1 : Print "   " : Else Goto TIMES1
  409. _CORRECTBOB
  410. Goto TIMES2
  411.  
  412. TIMES2:
  413. Pen 5 : Locate ,2 : Centre CB$+" 2"
  414. M=Mouse Zone
  415. Repeat 
  416.    K$=Inkey$
  417.    Clear Key 
  418.    If Lower$(K$)="q" or Asc(K$)=27
  419.       Goto SELECTION
  420.    End If 
  421.    Wait 1
  422. Until Mouse Key
  423. If M>2 Then Sam Play 3 : _CROSSBOB
  424. If M=2 Then Sam Play 2 : Locate X2,Y7 : Print "   " : Else Goto TIMES2
  425. _CORRECTBOB
  426. Goto TIMES3
  427.  
  428. TIMES3:
  429. Pen 5 : Locate ,2 : Centre CB$+" 3"
  430. M=Mouse Zone
  431. Repeat 
  432.    K$=Inkey$
  433.    Clear Key 
  434.    If Lower$(K$)="q" or Asc(K$)=27
  435.       Goto SELECTION
  436.    End If 
  437.    Wait 1
  438. Until Mouse Key
  439. If M>3 Then Sam Play 3 : _CROSSBOB
  440. If M=3 Then Sam Play 2 : Locate X1,Y2 : Print "   " Else Goto TIMES3
  441. _CORRECTBOB
  442. Goto TIMES4
  443.  
  444. TIMES4:
  445. Pen 5 : Locate ,2 : Centre CB$+" 4"
  446. M=Mouse Zone
  447. Repeat 
  448.    K$=Inkey$
  449.    Clear Key 
  450.    If Lower$(K$)="q" or Asc(K$)=27
  451.       Goto SELECTION
  452.    End If 
  453.    Wait 1
  454. Until Mouse Key
  455. If M>4 Then Sam Play 3 : _CROSSBOB
  456. If M=4 Then Sam Play 2 : Locate X2,Y8 : Print "   " : Else Goto TIMES4
  457. _CORRECTBOB
  458. Goto TIMES5
  459.  
  460. TIMES5:
  461. Pen 5 : Locate ,2 : Centre CB$+" 5"
  462. M=Mouse Zone
  463. Repeat 
  464.    K$=Inkey$
  465.    Clear Key 
  466.    If Lower$(K$)="q" or Asc(K$)=27
  467.       Goto SELECTION
  468.    End If 
  469.    Wait 1
  470. Until Mouse Key
  471. If M>5 Then Sam Play 3 : _CROSSBOB
  472. If M=5 Then Sam Play 2 : Locate X1,Y3 : Print "   " : Else Goto TIMES5
  473. _CORRECTBOB
  474. Goto TIMES6
  475.  
  476. TIMES6:
  477. Pen 5 : Locate ,2 : Centre CB$+" 6"
  478. M=Mouse Zone
  479. Repeat 
  480.    K$=Inkey$
  481.    Clear Key 
  482.    If Lower$(K$)="q" or Asc(K$)=27
  483.       Goto SELECTION
  484.    End If 
  485.    Wait 1
  486. Until Mouse Key
  487. If M>6 Then Sam Play 3 : _CROSSBOB
  488. If M=6 Then Sam Play 2 : Locate X2,Y9 : Print "   " : Else Goto TIMES6
  489. _CORRECTBOB
  490. Goto TIMES7
  491.  
  492. TIMES7:
  493. Pen 5 : Locate ,2 : Centre CB$+" 7"
  494. M=Mouse Zone
  495. Repeat 
  496.    K$=Inkey$
  497.    Clear Key 
  498.    If Lower$(K$)="q" or Asc(K$)=27
  499.       Goto SELECTION
  500.    End If 
  501.    Wait 1
  502. Until Mouse Key
  503. If M>7 Then Sam Play 3 : _CROSSBOB
  504. If M=7 Then Sam Play 2 : Locate X1,Y4 : Print "   " : Else Goto TIMES7
  505. _CORRECTBOB
  506. Goto TIMES8
  507.  
  508. TIMES8:
  509. Pen 5 : Locate ,2 : Centre CB$+" 8"
  510. M=Mouse Zone
  511. Repeat 
  512.    K$=Inkey$
  513.    Clear Key 
  514.    If Lower$(K$)="q" or Asc(K$)=27
  515.       Goto SELECTION
  516.    End If 
  517.    Wait 1
  518. Until Mouse Key
  519. If M>8 Then Sam Play 3 : _CROSSBOB
  520. If M=8 Then Sam Play 2 : Locate X2,Y10 : Print "   " : Else Goto TIMES8
  521. _CORRECTBOB
  522. Goto TIMES9
  523.  
  524. TIMES9:
  525. Pen 5 : Locate ,2 : Centre CB$+" 9"
  526. M=Mouse Zone
  527. Repeat 
  528.    K$=Inkey$
  529.    Clear Key 
  530.    If Lower$(K$)="q" or Asc(K$)=27
  531.       Goto SELECTION
  532.    End If 
  533.    Wait 1
  534. Until Mouse Key
  535. If M>9 Then Sam Play 3 : _CROSSBOB
  536. If M=9 Then Sam Play 2 : Locate X1,Y5 : Print "   " : Else Goto TIMES9
  537. _CORRECTBOB
  538. Goto TIMES10
  539.  
  540. TIMES10:
  541. Pen 5 : Locate ,2 : Centre CB$+"10"
  542. M=Mouse Zone
  543. Repeat 
  544.    K$=Inkey$
  545.    Clear Key 
  546.    If Lower$(K$)="q" or Asc(K$)=27
  547.       Goto SELECTION
  548.    End If 
  549.    Wait 1
  550. Until Mouse Key
  551. If M>10 Then Sam Play 3 : _CROSSBOB
  552. If M=10 Then Sam Play 2 : Locate X2,Y11 : Print "   " : Else Goto TIMES10
  553. _CORRECTBOB
  554. Goto TIMES11
  555.  
  556. TIMES11:
  557. Pen 5 : Locate ,2 : Centre CB$+"11"
  558. M=Mouse Zone
  559. Repeat 
  560.    K$=Inkey$
  561.    Clear Key 
  562.    If Lower$(K$)="q" or Asc(K$)=27
  563.       Goto SELECTION
  564.    End If 
  565.    Wait 1
  566. Until Mouse Key
  567. If M>11 Then Sam Play 3 : _CROSSBOB
  568. If M=11 Then Sam Play 2 : Locate X1,Y6 : Print "   " Else Goto TIMES11
  569. _CORRECTBOB
  570. Goto TIMES12
  571.  
  572. TIMES12:
  573. Pen 5 : Locate ,2 : Centre CB$+"12"
  574. M=Mouse Zone
  575. Repeat 
  576.    K$=Inkey$
  577.    Clear Key 
  578.    If Lower$(K$)="q" or Asc(K$)=27
  579.       Goto SELECTION
  580.    End If 
  581.    Wait 1
  582. Until Mouse Key
  583. If M=12 Then Sam Play 2 : Locate X2,Y12 : Print "   " : Else Goto TIMES12
  584. Locate ,2 : Cline 
  585. _CORRECTBOB12
  586. Fade 3 : Wait 25 : Track Stop : Show On 
  587. Goto SELECTION
  588.  
  589. '**************************** The Procedures ********************************
  590.  
  591. '----------------------------------------------------------------------------  
  592. 'These two Procedures designate which Bobs from the Bob bank are assigned to 
  593. 'the variables B1 to B5. 
  594. '                  ie. In _GIRLBOB, Bob 8 from the Bob bank is assigned to   
  595. '                      the variable B3, whereas in _BOYBOB the variable B3=3   
  596. 'Cls clears the title screen.  
  597. '----------------------------------------------------------------------------
  598. Procedure _BOYBOB
  599.    Cls : Wait 50
  600.    B1=1 : B2=2 : B3=3 : B4=4 : B5=5
  601. End Proc
  602.  
  603. Procedure _GIRLBOB
  604.    Cls : Wait 50
  605.    B1=6 : B2=7 : B3=8 : B4=9 : B5=10
  606. End Proc
  607.  
  608. '----------------------------------------------------------------------------  
  609. 'This Proc is used when we have clicked on the wrong 'Box' in TIMES1: to 
  610. 'TIMES12:
  611. 'We clear the line that reads "Click A Box to Complete Sum + "Sum number", 
  612. 'and print WB$-"Wrong Box - Try Again" on the same line. 
  613. 'We then return to the question again, hopefully to get it correct so we 
  614. 'can go to the next Procedure. 
  615. '----------------------------------------------------------------------------
  616. Procedure _CROSSBOB
  617.    Locate ,2 : Cline : Pen 4 : Centre WB$
  618.    Paste Bob 30,50,B3 : Wait 50 : Paste Bob 30,50,B1
  619. End Proc
  620.  
  621. '----------------------------------------------------------------------------  
  622. 'This Proc is used when we have clicked on the correct 'Box'in TIMES1: to
  623. 'TIMES12:
  624. 'In TIMES1: we set the value of both Y + ANSWER (Y=4 and ANSWER=1) 
  625. 'Therefore, on its first call Y=4. 
  626. 'On its next call Y will =6, as after the first call Y will equal Y(4) + 2.
  627. 'On its next call Y will =8, etc.etc.
  628. 'ANSWER will be the same as Y, except its value will only be raised by 1 each
  629. 'time this Procedure is entered. 
  630. '----------------------------------------------------------------------------
  631. Procedure _CORRECTBOB
  632.    Locate 46,Y : Pen 15 : Print A$(ANSWER)
  633.    Paste Bob 30,50,B2 : Wait 50 : Paste Bob 30,50,B1
  634.    Y=Y+2
  635.    ANSWER=ANSWER+1
  636. End Proc
  637.  
  638. '----------------------------------------------------------------------------    
  639. 'When sum 12 is correct we arrive from TIMES12: to this procedure. 
  640. 'Print the answer, hide the mouse pointer then draw a 'Tick' in the first
  641. 'little box at the side of the grid using the Polygon command.   
  642. 'The tick is then grabbed and stamped down in the other boxes at a space of
  643. 'TY(16pixels).   
  644. 'Remove the empty 'Boxes' by placing a Bar over the top of them. 
  645. 'Start the tracker module and 'Loop' it so it plays over and over again. 
  646. 'Form a loop to wait for the right mouse button to be pressed. 
  647. 'When the right mouse button is pressed, return to TIMES12: fade out screen 0, 
  648. 'stop the tracker module, re-show mouse pointer and goto SELECTION: to choose
  649. 'next TIMESTABLE??.
  650. '----------------------------------------------------------------------------
  651. Procedure _CORRECTBOB12
  652.    Locate 46,Y : Pen 15 : Print A$(12)
  653.    Hide 
  654.    Paste Bob 30,50,B2 : Wait 50 : Paste Bob 30,50,B4
  655.    Ink 4
  656.    Polygon 410,36 To 418,39 To 431,27 To 415,38 To 411,36 : Sam Play 5
  657.    Get Bob 11,406,28 To 434,42 : Wait 15
  658.    TY=44
  659.    For TB=1 To 11
  660.       Paste Bob 406,TY,11
  661.       Sam Play 5 : Wait 15
  662.       TY=TY+16
  663.    Next TB
  664.    Sam Play 4
  665.    Paste Bob 30,50,B5
  666.    Ink 0 : Bar 473,33 To 590,214
  667.    Locate ,2 : Pen 15 : Centre "Well Done!"
  668.    Locate ,28 : Cline : Centre "Well Done!"
  669.    Pen 5 : Locate 62,12 : Print "Please Press"
  670.    Locate 59,14 : Print "A Mouse Button"
  671.    Locate 61,16 : Print "to Select next"
  672.    Locate 62,18 : Print "TIMES TABLE"
  673.    Wait 25
  674.    Track Play 7
  675.    Track Loop On 
  676.    Do 
  677.       If Mouse Key Then Pop Proc
  678.    Loop 
  679. End Proc
  680.  
  681. '----------------------------------------------------------------------------
  682. 'This Proc Selects a random number between 0 and 9 and assigns the variables 
  683. 'Y1 to Y12.  
  684. 'X1 and X2 are the left and right hand sides to which the 'Boxes' shall be 
  685. 'placed. 
  686. 'On the random number being selected, we are taken to the appropriate
  687. '_POSITION?? and the Y Position of the 'Boxes' are assigned. 
  688. 'There 10 random positions available.
  689. '----------------------------------------------------------------------------
  690. Procedure _XYBOX_POSITION
  691.    
  692.    RB=Rnd(9)
  693.    If RB=0 : X1=60 : X2=69 : Goto _POSITION1 : End If 
  694.    If RB=1 : X1=69 : X2=60 : Goto _POSITION1 : End If 
  695.    If RB=2 : X1=60 : X2=69 : Goto _POSITION2 : End If 
  696.    If RB=3 : X1=69 : X2=60 : Goto _POSITION2 : End If 
  697.    If RB=4 : X1=60 : X2=69 : Goto _POSITION3 : End If 
  698.    If RB=5 : X1=69 : X2=60 : Goto _POSITION3 : End If 
  699.    If RB=6 : X1=60 : X2=69 : Goto _POSITION4 : End If 
  700.    If RB=7 : X1=69 : X2=60 : Goto _POSITION4 : End If 
  701.    If RB=8 : X1=60 : X2=69 : Goto _POSITION5 : End If 
  702.    If RB=9 : X1=69 : X2=60 : Goto _POSITION5 : End If 
  703.    
  704.    _POSITION1:
  705.    Y1=13 : Y2=5 : Y3=9 : Y4=21 : Y5=17 : Y6=25
  706.    Y7=21 : Y8=25 : Y9=5 : Y10=13 : Y11=9 : Y12=17
  707.    Pop Proc
  708.    
  709.    _POSITION2:
  710.    Y1=13 : Y2=5 : Y3=25 : Y4=21 : Y5=17 : Y6=9
  711.    Y7=21 : Y8=25 : Y9=17 : Y10=13 : Y11=9 : Y12=5
  712.    Pop Proc
  713.    
  714.    _POSITION3:
  715.    Y1=5 : Y2=25 : Y3=13 : Y4=9 : Y5=17 : Y6=21
  716.    Y7=13 : Y8=17 : Y9=21 : Y10=5 : Y11=25 : Y12=9
  717.    Pop Proc
  718.    
  719.    _POSITION4:
  720.    Y1=25 : Y2=9 : Y3=5 : Y4=21 : Y5=17 : Y6=13
  721.    Y7=21 : Y8=25 : Y9=13 : Y10=9 : Y11=5 : Y12=17
  722.    Pop Proc
  723.    
  724.    _POSITION5:
  725.    Y1=5 : Y2=17 : Y3=25 : Y4=13 : Y5=21 : Y6=9
  726.    Y7=25 : Y8=13 : Y9=9 : Y10=5 : Y11=17 : Y12=21
  727.    Pop Proc
  728. End Proc
  729.  
  730. '----------------------------------------------------------------------------
  731. 'If Esc. key is pressed at title screen then we jump to this label and 
  732. 'return to the End.  
  733. '----------------------------------------------------------------------------
  734. _RETURN_TO_EDITSCREEN:
  735. End 
  736. 'Above line changed by Conor Kerr 1998